<?php

/**
 * @copyright 2011
 * @version $Id$
 * @access public
 * @author Oriotiori

 */

class Admin_Model_Facade_Paypal{

	/**
	 * @param array $to: Array de datos a guardar.
	 * @return int $lastid
	 */
	public function updatePaypalAccount($to)
	{
		$TBD_Resource = new Admin_Model_Paypal();
		try{
			$data = $TBD_Resource->updatePaypalAccount($to);
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}



	/**
	 * @param int $id
	 * @return boolean
	 */
	public function getPaypalAccount()
	{
		$TBD_Resource = new Admin_Model_Paypal();
		try{
			$data = $TBD_Resource->getPaypalAccount();
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}


	/**
		* @param int $id
		* @return boolean
		*/
	public function TestConfigPaypalAccount($to=null)
	{
		$TBD_Resource = new Admin_Model_Paypal();
		try{
			$data = $TBD_Resource->TestConfigPaypalAccount($to);
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}


}
